﻿@model TaoNiuOA.Models.User
@{
    ViewBag.Title = "个人信息";
    Layout = "~/Views/Shared/_AdminLayout.cshtml";

    var userInfo = Model.GetUserInfo();
}
<form id="form1" action="" method="post">
@Html.HiddenFor(m => m.UserID)
<fieldset>
    <legend>个人信息</legend>
    <div id="tip" style="color: Red; text-align: center; font-size: large;">
    </div>
    <br />
    <table>
        <tr>
            <td>
                用户名
            </td>
            <td>
                @Html.DisplayFor(model => model.UserName)
            </td>
        </tr>
        <tr>
            <td>
                姓名
            </td>
            <td>
                <input type="text" id="Name" name="Name" value="@userInfo.Name" />
            </td>
        </tr>
        <tr>
            <td>
                邮箱
            </td>
            <td>
                @Html.EditorFor(model => model.Email)
            </td>
        </tr>
        <tr>
            <td>
                部门
            </td>
            <td>
                @Html.DisplayFor(model => model.GetDepartment().Name)
            </td>
        </tr>
        <tr>
            <td>
                职位
            </td>
            <td>
                @Html.DisplayFor(model => model.GetUserGroup().GroupName)
            </td>
        </tr>
        <tr>
            <td>
                性别
            </td>
            <td>
                @{
                    if (userInfo.Sex == true)
                    {
                    <select id="Sex" name="Sex">
                        <option value="true" selected="selected">男</option>
                        <option value="false">女</option>
                    </select>
                    }
                    else
                    {
                    <select id="Sex" name="Sex">
                        <option value="true">男</option>
                        <option value="false" selected="selected">女</option>
                    </select>
                    }
                }
            </td>
        </tr>
        <tr>
            <td>
                生日
            </td>
            <td>
                <script src="../../Plusins/timeplus/WdatePicker.js" type="text/javascript"></script>
                <input type="text" id="Birthday" name="Birthday" value="@string.Format("{0:d}", userInfo.Birthday)" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" class="Wdate" />
            </td>
        </tr>
        <tr>
            <td>
                电话
            </td>
            <td>
                <input type="text" id="Tel" name="Tel" value="@userInfo.Tel" />
            </td>
        </tr>
        <tr>
            <td>
                手机
            </td>
            <td>
                <input type="text" id="Mobile" name="Mobile" value="@userInfo.Mobile" />
            </td>
        </tr>
        <tr>
            <td>
                QQ
            </td>
            <td>
                <input type="text" id="QQ" name="QQ" value="@userInfo.QQ" />
            </td>
        </tr>
        <tr>
            <td>
                MSN
            </td>
            <td>
                <input type="text" id="Msn" name="Msn" value="@userInfo.Msn" />
            </td>
        </tr>
        <tr>
            <td>
                身份证
            </td>
            <td>
                <input type="text" id="Id" name="Id" value="@userInfo.Id" />
            </td>
        </tr>
        <tr>
            <td>
                开户银行
            </td>
            <td>
                <input type="text" id="BankName" name="BankName" value="@userInfo.BankName" />
            </td>
        </tr>
        <tr>
            <td>
                银行帐号
            </td>
            <td>
                <input type="text" id="BankAccount" name="BankAccount" value="@userInfo.BankAccount" />
            </td>
        </tr>
        <tr>
            <td>
                地址
            </td>
            <td>
                <input type="text" id="Address" name="Address" value="@userInfo.Address" />
            </td>
        </tr>
        <tr>
            <td>
                邮编
            </td>
            <td>
                <input type="text" id="Postcode" name="Postcode" value="@userInfo.Postcode" />
            </td>
        </tr>
        <tr>
            <td>
                密码保护问题
            </td>
            <td>
                @Html.EditorFor(model => model.PasswordQuestion)
            </td>
        </tr>
        <tr>
            <td>
                密码保护答案
            </td>
            <td>
                @Html.EditorFor(model => model.PasswordAnswer)
            </td>
        </tr>
        <tr>
            <td>
                注册时间
            </td>
            <td>
                @Html.DisplayFor(model => model.RegTime)
            </td>
        </tr>
        <tr>
            <td>
                最后登录
            </td>
            <td>
                @Html.DisplayFor(model => model.LastActivityTime)
            </td>
        </tr>
    </table>
    <br />
    <div>
        <input type="submit" value="更新个人信息" onclick="return che();" />
    </div>
</fieldset>
</form>
<script src="../../Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
<script type="text/javascript">
    function che() {
        if ($("#Name").val() == "") {
            alert("请填写姓名!");
            return false;
        }
    }
</script>

